<ul class="list-group list-group-flush">


    @foreach($replies as $floor => $reply)

        <li id="reply{{$reply->id}}" class="d-flex align-items-center list-group-item d-flex topic_intro">

            <a class="flex-shrink-0" href="{{route('users.show',$reply->user_id)}}">
                <img width="50" class="img-thumbnail" src="{{$reply->user->avatar}}"
                     alt="{{$reply->user->name}}">
            </a>
            <div class="flex-grow-1 px-2">
                {{--回复人和时间--}}
                <div class="">
                    <small><i class="fa-regular fa-user"></i>
                        <a class="text-decoration-none text-secondary"
                           href="{{route('users.show',$reply->user_id)}}">{{$reply->user->name}}</a></small>
                    <span>  ·   </span>
                    <small><i class="fa-regular fa-clock"></i>
                        <a class="text-decoration-none text-secondary">{{$reply->created_at->diffForHumans()}}</a></small>

                </div>
                {{--内容--}}
                <a class="text-decoration-none text-success" href="#">
                    {!! $reply->content !!}
                </a>
            </div>
            <div class="d-inline-flex">

                {{--点赞--}}
                <form action="#" method="post" onsubmit="return confirm('是否点赞感谢该回复？')">
                    @csrf
                    <button class="btn btn-sm btn-outline-secondary border-0 text-decoration-none text-secondary-emphasis" type="submit">
                        <i class="fa-regular fa-thumbs-up"></i>
                    </button>
                </form>

                {{--删除--}}
                @can('destroy',$reply)
                <form action="{{route('replies.destroy',$reply->id)}}" method="post" onsubmit="return confirm('是否删除评论？')">
                    @csrf
                    @method('DELETE')
                    <button class="btn btn-sm btn-outline-danger border-0 text-decoration-none text-secondary-emphasis" type="submit">
                        <i class="fa-regular fa-trash-can"></i>
                    </button>
                </form>
                @endcan

                {{--楼层--}}
                <a class="ms-1 text-decoration-none pointerNone">
                    <span class="reply_num">{{$count-$floor}}</span>
                </a>

            </div>

        </li>

    @endforeach




</ul>
